cdi install logic change, test(install): add shellcheck + bats harness for prebake logic - #166
Merged
Ganeshkumar Ashokavardhanan (ganeshkumarashok) merged 2 commits intoAug 5, 2026
Conversation
The prebake mode dispatch (build-only / install-skip-build / install), the dkms marker write/parse/validate, and the opportunistic fast-path fallback previously had no automated guard -- CI only ran `docker buildx build` (xuexu6666 review on #162). - make install.sh sourceable for unit tests: move set-flags + config/helper sources + EXIT trap into main(), guard main() behind BASH_SOURCE, extract purge_gpu_cache, parameterize config/modules paths. Behavior-preserving (execution still runs main()). - test/install.bats: 15 tests (marker write/parse/validate, fast-path fallback, target-kernel selection, all three dispatch modes). - ci.yaml: new lint-and-test job (shellcheck install.sh+entrypoint.sh, bats test/). Local: shellcheck clean, bats 15/15 pass. Signed-off-by: Ganeshkumar Ashokavardhanan <aganeshkumar@microsoft.com>
* fix: initialize NVIDIA driver before CDI toolkit Stage the driver userspace libraries and validate nvidia-smi before installing NVIDIA Container Toolkit, whose package post-install immediately starts nvidia-cdi-refresh. Regenerate CDI after runtime and device-link configuration, and cover the lifecycle ordering with Bats. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3becde0-b693-48d3-b13b-801b0ebee848 * fix: clear CDI start limit before regeneration The toolkit post-install and path unit can consume the oneshot service's start budget before the final authoritative restart. Clear that transient counter while continuing to propagate a real restart failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b3becde0-b693-48d3-b13b-801b0ebee848 --------- Copilot-Session: b3becde0-b693-48d3-b13b-801b0ebee848
sulixu
approved these changes
Aug 5, 2026
Ganeshkumar Ashokavardhanan (ganeshkumarashok)
merged commit Aug 5, 2026
eed69ec
into
main
8 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an automated test harness for the prebake runtime logic introduced in #162. Previously the
mode dispatch (
build-only/install-skip-build/install), the dkms marker write/parse/validate,and the opportunistic fast-path fallback were only exercised by the cross-repo AgentBaker e2e — CI
here ran
docker buildx buildonly (no script execution, no shellcheck). This addresses that gap(xuexu6666's review comment on #162).
Changes
install.sh— made sourceable for unit testing, behavior-preserving:set -euxo pipefail, theconfig/helpersources, and the EXIT trap into a newmain()main()behindBASH_SOURCE(executes only when run directly; sourcing loads functions only)rm -r /opt/gpuintopurge_gpu_cacheAKSGPU_CONFIG_PATH/AKSGPU_MODULES_ROOT) for fixturesmain).test/install.bats— 15 tests: marker write/parse/validate (kernel/version/kind/missing-filemismatches),
fast_path_okfallback,target_build_kernelnewest-selection + fallback, and allthree dispatch modes.
.github/workflows/ci.yaml— newlint-and-testjob:shellcheckoninstall.sh+entrypoint.sh,and
bats test/.Validation
shellcheck -S warning install.sh entrypoint.sh— cleanbats test/install.bats— 15/15 passmainruns; sourcing → it does not)